﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IM.Easy.Core.Enums
{
    /// <summary>
    /// 定义 API 返回的状态码，包括标准 HTTP 状态码和业务类型错误码.
    /// </summary>
    public enum ResultCode
    {
        // 标准 HTTP 状态码
        /// <summary>
        /// 成功.
        /// </summary>
        Success = 200,

        /// <summary>
        /// 错误请求.
        /// </summary>
        BadRequest = 400,

        /// <summary>
        /// 未授权.
        /// </summary>
        Unauthorized = 401,

        /// <summary>
        /// 禁止访问.
        /// </summary>
        Forbidden = 403,

        /// <summary>
        /// 未找到.
        /// </summary>
        NotFound = 404,

        /// <summary>
        /// 内部服务器错误.
        /// </summary>
        InternalServerError = 500,

        // 业务类型错误码
        /// <summary>
        /// 业务逻辑错误.
        /// </summary>
        BusinessLogicError = 1000,

        /// <summary>
        /// 数据库操作失败.
        /// </summary>
        DatabaseOperationFailed = 1001,

        /// <summary>
        /// 无效的用户输入.
        /// </summary>
        InvalidUserInput = 1002,

        /// <summary>
        /// 资源已存在.
        /// </summary>
        ResourceAlreadyExists = 1003,

        /// <summary>
        /// 需要进行身份验证.
        /// </summary>
        AuthenticationRequired = 1004,

        /// <summary>
        /// 权限不足.
        /// </summary>
        InsufficientPermissions = 1005
    }


}
